﻿@model WarOfDev.Web.ViewModels.TaskViewModel

@{
    ViewBag.Title = "Edit";
}

<h2>Edit</h2>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>Task</legend>

        @Html.HiddenFor(model => model.Id)

        <div class="editor-label">
            @Html.LabelFor(model => model.Title)
        </div>
        <div class="editor-field">
            @Html.TextBoxFor(model => model.Title)
            @Html.ValidationMessageFor(model => model.Title)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Description)
        </div>
        <div class="editor-field">
            @Html.TextAreaFor(model => model.Description, new { rows=10,cols=50})
            @Html.ValidationMessageFor(model => model.Description)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ExperienceValue)
        </div>
            @Html.Action("TaskExperienceValueCollectionHasDefaultValue", new { defaultValue = Model.ExperienceValue })
        
        <div class="editor-label">
            @Html.LabelFor(model => model.StatusName)
        </div>
        <div class="editor-field">
        @if (Model.TaskStatusList != null && Model.TaskStatusList.Count > 0)
        {
            @Html.DropDownList("Status", Model.TaskStatusList)
        }
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.DeveloperId)
        </div>
            @Html.DropDownList("DeveloperId",Model.AllDeveloperList)
        <p>
            <input type="submit" value="Save" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
